﻿using System;
using System.Collections.Generic;

namespace HYRevitCode.XYZUtility
{
	public class CurveParamPointComparer : IComparer<CurveParamPoint>
	{
		public int Compare(CurveParamPoint curvePoint1, CurveParamPoint curvePoint2)
		{
			if (Math.Abs(curvePoint1.ParamOnCurve - curvePoint2.ParamOnCurve) <= CurveParamPointComparer.dEpsilon)
			{
				return 0;
			}
			if (curvePoint2.ParamOnCurve - curvePoint1.ParamOnCurve > CurveParamPointComparer.dEpsilon)
			{
				return -1;
			}
			return 1;
		}

		public static double dEpsilon = 1E-06;
	}
}
